WIDGET = {ID: '9RIVfNPhR3'};
var getNotice = JSON.parse(localStorage.getItem('data-1'))||[];
var getName = JSON.parse(localStorage.getItem('loginUser')).name;
var getJurisdiction = JSON.parse(localStorage.getItem('staff'));




$(document).ready(function(){
    var str=getNotice[getNotice.length-1].time;
    var str1=getNotice[getNotice.length-1].name[0];
    var arr=str.split(" ");
    var arr1=str1.split(":");
    $('#notice-font').html(getNotice[getNotice.length-1].content2);
    $('.release-peo').text(arr1[0]);
    $('.release-tim').text(arr[0]);

});


// 基于准备好的dom，初始化echarts实例
var myChart1 = echarts.init(document.getElementById('main1'));
var myChart2 = echarts.init(document.getElementById('main2'));

// 指定图表的配置项和数据
var option1 = {
    title: {
        text: '今日学生考勤'
    },
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'right',
        data:['准时','迟到','缺勤','请假']
    },
    color:['#F0AD4E','#337AB7','#5CB85C','#5BC0DE'],
    series: [
        {
            name:'访问来源',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:12, name:'迟到'},
                {value:55, name:'准时'},
                {value:5, name:'缺勤'},
                {value:10, name:'请假'},

            ]
        }
    ]
};

// 使用刚指定的配置项和数据显示图表。
myChart1.setOption(option1);
// 指定图表的配置项和数据
var option2 = {
    title: {
        text: '今日老师考勤'
    },
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'right',
        data:['准时','迟到','缺勤','请假']
    },
    color:['#F0AD4E','#337AB7','#5CB85C','#5BC0DE'],
    series: [
        {
            name:'访问来源',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:3, name:'迟到'},
                {value:20, name:'准时'},
                {value:2, name:'缺勤'},
                {value:1, name:'请假'},

            ]
        }
    ]
};

// 使用刚指定的配置项和数据显示图表。
myChart2.setOption(option2);
